package com.ssy.lingxi.order.model.vo.common.response;

import com.ssy.lingxi.order.model.constant.OrderServiceContants;
import com.ssy.lingxi.order.utils.NumberUtil;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商城首页 - 查询商品成交动态返回
 * @author 万宁
 * @version 2.0.0
 * @date 2021-08-12
 */
public class OrderProductShopHistoryVO implements Serializable {
    private static final long serialVersionUID = 6851388107347140464L;

    public OrderProductShopHistoryVO(LocalDateTime createTime, String productName, String category, String brand, String spec, String unit, BigDecimal quantity) {
        this.createTime = createTime.format(OrderServiceContants.DEFAULT_TIME_FORMATTER);
        this.productName = productName;
        this.category = category;
        this.brand = brand;
        this.spec = spec;
        this.unit = unit;
        this.quantity = NumberUtil.formatToInteger(quantity);
    }

    /**
     * 订单时间，格式为yyyy-MM-dd HH:mm:ss
     */
    private String createTime;

    /**
     * 商品名称
     */
    private String productName;

    /**
     * 品类
     */
    private String category;

    /**
     * 品牌
     */
    private String brand;

    /**
     * 规格
     */
    private String spec;

    /**
     * 计价单位
     */
    private String unit;

    /**
     * 数量
     */
    private String quantity;

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getQuantity() {
        return quantity;
    }

    public void setQuantity(String quantity) {
        this.quantity = quantity;
    }
}
